﻿package stfei.HorizList.Obj
{
	/**
	* ...
	* 多行多列注册点排列-接口实现
	*/
	import stfei.HorizList.core.IRegPoint;
	public class RegPointList implements IRegPoint
	{
		//------------类变量---------------
		//注册点数组
		private var RegPoint:Array = new Array();
		//／设置列数
		public var _listColumn:Number;
		//／设置行数
		public var _listRow:Number;
		//间距值
		public var _spaceX:Number;
		public var _spaceY:Number;
		///影片宽
		public var mcW:Number;
		///影片高
		public var mcH:Number;
		//------------构造函数-------------
		function RegPointList()
		{
			init();
		}
		//-----------初始化默认值----------
		private function init():void
		{
			_listRow = 3;
			_listColumn = 3;
			_spaceY = 5;
			_spaceX = 5;
		}
		//------------类方法---------------
		//创建注册点计算返回数组
		public function CreatePointVal():Array
		{
			var tol:Number = _listColumn * _listRow;
			//当前的行数计数
			var CurrentRow:Number = 1;
			//列计数
			var j:Number = 0;
			//循环计算注册点
			for (var i:Number = 0; i<tol; i++) {
				if (i >= _listColumn * CurrentRow) {
					//换行+1并清除列记录器
					CurrentRow++;
					j = 0;
				}
				var x:Number = (mcW+_spaceX)*j;
				var y:Number = (mcH+_spaceY)*(CurrentRow-1);
				//写入数组
				RegPoint[i] = new Array();
				RegPoint[i][0] = x;
				RegPoint[i][1] = y;
				j++;
			}
			return RegPoint;
		}
	}
}